package com.ice.work.moment.tencent.facade.controller;


import com.honeybee.cloud.framework.common.annotation.ApiVersion;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import com.ice.work.moment.tencent.facade.controller.fallback.WxUserHystrixFallbackFactory;
import com.ice.work.moment.tencent.facade.request.AddUserRequest;
import com.ice.work.moment.tencent.facade.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Description
 * @Author DELL
 * @Create 2019-04-29
 * @Since 1.0.0
 */
@FeignClient(value = "moment-tencent-user-v1", fallbackFactory = WxUserHystrixFallbackFactory.class)
@RequestMapping("tencent-user/{version}")
@ApiVersion
public interface IWxUserController {

    /**
     * 新增登录用户
     *
     * @param request
     * @return
     */
    @RequestMapping(name = "新增登录用户", value = "add-user", method = RequestMethod.POST)
    ResponseEntity<Void> addUser(@Validated @RequestBody AddUserRequest request);

    /**
     * 查询登录用户信息
     *
     * @param openId
     * @return
     */
    @RequestMapping(name = "查询登录用户信息", value = "find-user/{openId}", method = RequestMethod.GET)
    ResponseEntity<UserVO> findUserByOpenId(@Validated @PathVariable String openId);

}
